<template>
  <table class="table table-bordered table-stripped">
    <!-- 表格标题区域 -->
    <thead>
      <!-- <tr>
        <th>#</th>
        <th>商品名称</th>
        <th>价格</th>
        <th>标签</th>
        <th>操作</th>
      </tr> -->
      <slot name="title"></slot>
    </thead>
    <!-- 表格主体区域 -->
    <tbody>
      <!--  -->
      <tr v-for="item in goods" :key="item.id">
        <!-- <td>{{ item.id }}</td>
        <td>{{ item.goods_name }}</td>
        <td>{{ item.goods_price }}</td>
        <td>{{ item.tags }}</td>
        -->
        <slot name="body" :row="item"></slot>
      </tr>
    </tbody>
  </table>
</template>

<script>
export default {
  name: "MyTable",
  props: {
    goods: {
      required: true, // 必须传入此变量的
      type: Array, //要求传递的类型
    },
  },
};
</script>

<style scoped>
.badge {
  margin-right: 5px;
}
</style>
